<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes" encoding="iso-8859-1"/>
<xsl:include href="settings.xsl"/>
<xsl:include href="convert.xsl"/>

<xsl:param name="page_id" select="/page/page_id"/>

<xsl:template match="/">
	<html>
		<head>
			<title><xsl:value-of select="/page/header"/></title>
			<META><xsl:attribute name="description"><xsl:value-of select="/page/description" disable-output-escaping="yes"/></xsl:attribute></META>
			<META><xsl:attribute name="keywords"><xsl:value-of select="/page/keywords" disable-output-escaping="yes"/></xsl:attribute></META>
			<META NAME="authors" CONTENT="MLS Solutions"/>
			<meta name="revisit-after" content="2 days"/>
			<META NAME="robots" CONTENT="index, follow"/>
			<META NAME="distribution" CONTENT="GLOBAL"/>
			<META NAME="classification" CONTENT="Recreation"/>
			<META NAME="copyright" CONTENT="Copyright 2003 MLS Solutions"/>
			<META HTTP-EQUIV="reply-to" CONTENT="info@yachtcouncil.org"/>
			<link rel="stylesheet" href="include/main.css" type="text/css"/>
		</head>
		<body link="{$color_main_first}" vlink="{$color_main_first}" alink="{$color_main_first}" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0" text="{$color_main_first}" bgcolor="{$bg_pagecolor}">
			<xsl:choose>
			<xsl:when test="//page/isNeedMenu=1">
			<xsl:call-template name="header"/>
			</xsl:when>
			</xsl:choose>
		</body>
	</html>
</xsl:template>

<xsl:template name="header">
	<xsl:choose>
		<xsl:when test="/page/theme = 1"><xsl:call-template name="header_vertical"/></xsl:when>
 		<xsl:otherwise><xsl:call-template name="header_horizontal"/></xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template name="header_vertical">
	<table cellspacing="0" width="100%"  cellpadding="0">
<tr>
    <td rowspan="3" bgcolor="{$header_bg}" valign="top" align="center">
	<table cellspacing="2" cellpadding="2" border="0">
	<tr>
	    <td><a href="http://www.yachtcouncil.com/" target="_blank" title="Yacht Council"><img src="{$img_path_templates}/{$header_bg_color}/logo_mls.gif" border="0" hspace="10" vspace="10" align="top" alt="Boats, yachts, sailboats"/></a></td>
	</tr>
	<tr>
	    <td><img src="{$img_path_templates}/spacer.gif" width="160" height="3" border="0"/></td>
	</tr>
	</table>

	
	</td>
    <td colspan="2" width="100%"  bgcolor="{$header_bg}">
			<table width="100%" cellpadding="0" cellspacing="1">
		<tr>
		<td colspan="2"><a href="default.asp" target="_top" title="{//page/member_name}"><h2 style="font-weight: normal; margin : 0 0 0 0; margin-bottom : 0;	margin-left : 0;	margin-top : 0;"><font color="#FFFFFF" ><xsl:value-of select="//page/member_name"/></font></h2></a>
			<font class="s2" color="#ffffff"><nobr> a <a href="http://www.yachtcouncil.com" title="Yacht Council" class="s2"><font color="#FFFFFF">Yacht Council</font></a>  Network member.</nobr></font>
		</td>
		<td colspan="2"  align="right"><xsl:call-template name="logos"/></td>
		</tr>
		</table>
	
	</td>
    <td rowspan="2" width="1%" valign="bottom" bgcolor="{$header_bg}"><img src="{$img_path_templates}/{$header_bg_color}/images/vert_03.gif" width="14" height="41" alt=""/></td>
</tr>
<tr>
    <td rowspan="2" width="1%"><img src="{$img_path_templates}/{$header_bg_color}/images/vert_04.gif" width="38" height="40"/></td>
    <td><table cellspacing="0" cellpadding="0" border="0">
		<tr>
		<td width="100%" background="{$img_path_templates}/{$header_bg_color}/images/vert_05.gif">
			<img src="{$img_path_templates}/spacer.gif" width="250" height="3" border="0"/>
		</td>		
			<td valign="top" width="44"><img src="{$img_path_templates}/{$header_bg_color}/images/vert_06.gif" width="44" height="24"/></td>
		<td  background="{$img_path_templates}/{$header_bg_color}/images/vert_07.gif" align="right">
			<nobr>
				<img src="{$img_path_templates}/spacer.gif" width="20" height="3" border="0"/>
				<br/>
				<img src="{$img_path_templates}/spacer.gif" width="50" height="3" border="0"/>
				<br/>
				<font color="{$link_c_menu}"><nobr>
				<xsl:if test="//page/static_links/yacht_insurance_link=1">
					<a href="premium_insurance_companies.asp" class="listtitle" title="Yacht Insurance" target="_top">
						<font color="{$link_c_menu}">Yacht Insurance</font>
					</a>
				</xsl:if>	
				<xsl:if test="//page/static_links/yacht_insurance_link=1 and  //page/static_links/yacht_finance_link=1">&#160;|&#160;</xsl:if>	
				<xsl:if test="//page/static_links/yacht_finance_link=1">
					<a href="premium_finance_companies.asp" class="listtitle" title="Yacht Finance" target="_top">
						<font color="{$link_c_menu}">Yacht Finance</font>
					</a>
				</xsl:if>
				<xsl:if test="(//page/static_links/yacht_insurance_link=1 or  //page/static_links/yacht_finance_link=1) and //page/static_links/weather=1">&#160;|&#160;</xsl:if>	
				<xsl:if test="//page/static_links/weather=1">		
					<a href="weather.asp" class="listtitle" title="Weather" target="_top">
						<font color="{$link_c_menu}">Weather</font>
					</a>
				</xsl:if></nobr>
				</font>
				<img src="{$img_path_templates}/spacer.gif" width="20" height="3" border="0"/>
			</nobr>
			<br/>
			<img src="{$img_path_templates}/spacer.gif" width="100" height="3" border="0"/>
		</td>	
		</tr>
		</table></td>
</tr>
<tr>
    <td colspan="2" width="100%"><img src="{$img_path_templates}/spacer.gif" width="273" height="16" border="0"/></td>
</tr>
</table>

</xsl:template>



<xsl:template name="header_horizontal">
	<table cellpadding="0" cellspacing="0" width="760" align="center">
	<tr><td bgcolor="{$header_bg}" class="listtitle">
	<xsl:if test="count(/print)=0">
		<table cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td class="listtitle">
				<table cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td rowspan="3" align="center">
						<a href="http://www.yachtcouncil.com/" target="_blank" title="Yacht Council"><img src="{$img_path_templates}/{$header_bg_color}/logo_mls.gif" border="0" hspace="5" vspace="4" align="top" alt="Boats, yachts, sailboats"/></a>
					</td>
					<td rowspan="2">
						<!-- <a href="http://www.yachtcouncil.com/" target="_blank" title="Yacht Council">
							<img src="{$img_path_templates}/{$header_bg_color}/yachtcouncil.gif" border="0" hspace="0" vspace="0" align="top" alt="Boats, yachts, sailboats"/>
						</a> -->
						<a href="default.asp" title="{//page/member_name}" target="_top"><h2 style="font-weight: normal; margin : 0 0 0 0; margin-bottom : 0;	margin-left : 0;	margin-top : 0;"><font color="#FFFFFF" ><xsl:value-of select="/page/member_name"/></font></h2>
						</a>
						<!-- <br/>  -->
						<font class="s2" color="#ffffff">
							<nobr>
								 a proud member of <a href="http://www.yachtcouncil.com" title="Yacht Council" class="s2" target="_top"><font color="#FFFFFF">Yacht Council</font></a> Network.
							</nobr>
						</font>
					</td>
					<td align="right"><xsl:call-template name="logos"/></td>
				</tr>
				<tr>
					<td class="listtitle" align="right">
					<xsl:choose>
					<xsl:when test="//page/static_links/yacht_insurance_link=0 and //page/static_links/yacht_finance_link=0 and //page/static_links/weather=0"><img src="{$img_path_templates}/spacer.gif" border="0" hspace="0" width="120" height="2" vspace="2" align="top"/>
					</xsl:when>
					<xsl:otherwise>
					<table cellspacing="0" cellpadding="0" border="0" align="right">
						<tr>
							<td bgcolor="{$header_bg}">
								<img src="{$img_path_templates}/{$header_bg_color}/center_top.gif" width="19" height="23" border="0"/>
							</td>
							<td class="listtitle" bgcolor="{$bg_c_bot}"><font color="{$link_c_menu}"><nobr>
											<xsl:if test="//page/static_links/yacht_insurance_link=1">
					<a href="premium_insurance_companies.asp" class="listtitle" target="_top" title="Yacht Insurance">
						<font color="{$link_c_menu}">Yacht Insurance</font>
					</a>
				</xsl:if>	
				<xsl:if test="//page/static_links/yacht_insurance_link=1 and  //page/static_links/yacht_finance_link=1">&#160;|&#160;</xsl:if>	
				<xsl:if test="//page/static_links/yacht_finance_link=1">
					<a href="premium_finance_companies.asp" class="listtitle" target="_top" title="Yacht Finance">
						<font color="{$link_c_menu}">Yacht Finance</font>
					</a>
				</xsl:if>
				<xsl:if test="(//page/static_links/yacht_insurance_link=1 or  //page/static_links/yacht_finance_link=1) and //page/static_links/weather=1">&#160;|&#160;</xsl:if>	
				<xsl:if test="//page/static_links/weather=1">		
					<a href="weather.asp" class="listtitle" target="_top" title="Weather">
						<font color="{$link_c_menu}">Weather</font>
					</a>
				</xsl:if>
					&#160;&#160;</nobr></font>
						</td>
						</tr>
						</table>
						
						</xsl:otherwise>
					</xsl:choose>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td background="{$img_path_templates}/{$header_bg_color}/bg_top.gif"><img src="{$img_path_templates}/spacer.gif" border="0" hspace="0" vspace="2" align="top"/></td>
		</tr>
		<tr>
			<td bgcolor="{$bg_c_bot}">
				<table bgcolor="{$bg_c_bot}">
				<tr bgcolor="{$bg_c_bot}">
					<td class="listtitle" valign="bottom">&#160;</td>
					<td class="listtitle" valign="bottom">
						<nobr>
							<a href="default.asp" class="listtitle" target="_top" title="{/page/home_page_name}">
								<h3 style="margin:0; FONT-SIZE: 12px; COLOR: {$link_c_menu};"><font color="{$link_c_menu}"><xsl:value-of select="//page/home_page_name"/></font></h3>
							</a>
						</nobr>
					</td>
					<td valign="bottom"><h3 class="listtitle" style="margin:0; COLOR: {$link_c_menu};">&#160;|&#160;</h3></td>
					<td valign="bottom">
						<a href="my_vessels_list.asp" class="listtitle" target="_top" title="{//page/featured_vessels_page_name}">
							<h3 style="margin:0; FONT-SIZE: 12px; COLOR: {$link_c_menu};"><font color="{$link_c_menu}"><xsl:value-of select="//page/featured_vessels_page_name"/></font></h3>
						</a>
					</td>
					<td valign="bottom"><h3 class="listtitle" style="margin:0; FONT-SIZE: 12px; COLOR: {$link_c_menu};" >&#160;|&#160;</h3></td>
					<td valign="bottom">
						<a href="global_search.asp" class="listtitle" target="_top" title="{//page/global_search_page_name}">
							<h3 style="margin:0; FONT-SIZE: 12px; COLOR: {$link_c_menu};"><font color="{$link_c_menu}"><xsl:value-of select="//page/global_search_page_name"/></font></h3>
						</a>
					</td>
					<td valign="bottom"><h3 class="listtitle" style="margin:0; FONT-SIZE: 12px; COLOR: {$link_c_menu};" >&#160;|&#160;</h3></td>
					<td valign="bottom">
						<nobr>
							<a href="contact_us.asp" class="listtitle" target="_top" title="{//page/contact_us_page_name}"><h3 style="margin:0; FONT-SIZE: 12px;  COLOR: {$link_c_menu};"><font color="{$link_c_menu}"><xsl:value-of select="//page/contact_us_page_name"/></font></h3></a>
						</nobr>
					</td>
					<xsl:for-each select="/page/additional_pages/additional_page">
						<td valign="bottom"><h3 class="listtitle" style="margin:0; FONT-SIZE: 12px; COLOR: {$link_c_menu};" >&#160;|&#160;</h3></td>
						<td valign="bottom">
							<xsl:choose>
							<xsl:when test="frame=1">
								<nobr>
								<a href="test_frames.asp?file_name={file_name}" target="_top" class="listtitle" style="color: {$link_c_menu}; font-weight: bold;" title="{title}"><h3 style="margin:0; FONT-SIZE: 12px; COLOR: {$link_c_menu};"><font color="{$link_c_menu}"><xsl:value-of select="title"/></font></h3></a>
								</nobr>
							</xsl:when>
							<xsl:otherwise>
							<nobr>
							<a href="{$files_templates}/{file_name}" target="_top" class="listtitle" style="color: {$link_c_menu}; font-weight: bold;" title="{title}"><h3 style="margin:0; FONT-SIZE: 12px; COLOR: {$link_c_menu};"><font color="{$link_c_menu}"><xsl:value-of select="title"/></font></h3></a></nobr>
							</xsl:otherwise>
							</xsl:choose>
						</td>
					</xsl:for-each>
				</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td bgcolor="{$bg_c_bot}">
				<table width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td bgcolor="{$bg_pagecolor}"><img src="{$img_path_templates}/{$header_bg_color}/bg_left.gif" width="7" height="5" border="0"/></td>
					<td width="100%"><img src="{$img_path_templates}/spacer.gif" width="7" height="5" border="0"/></td>
					<td bgcolor="{$bg_pagecolor}"><img src="{$img_path_templates}/{$header_bg_color}/bg_right.gif" width="7" height="5" border="0"/></td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
	</xsl:if>
	</td></tr>
	<tr><td>
	<!-- <xsl:if test="/page/companies_logo and contains(/page/companies_logo, 'jpg')">
	<table cellpadding="0" cellspacing="0" width="760" align="center">
		<tr>
			<td align="center">
				<img>
					<xsl:attribute name="src"><xsl:value-of select="$media_path"/><xsl:value-of select="//page/companies_logo"/></xsl:attribute>
					<xsl:attribute name="vspace">10</xsl:attribute>
					<xsl:attribute name="align"><xsl:value-of select="companies_logo/@align"/></xsl:attribute>
					<xsl:attribute name="alt"><xsl:value-of select="/page/rowset/data/row/col[@name]"/></xsl:attribute>
				</img>
			</td>
		</tr>
	</table>
	</xsl:if> -->
	<xsl:apply-templates select="page"/>
	
	
	</td></tr>
	</table>
</xsl:template>

<xsl:template name="logos">
	<xsl:variable name="col_count" select="metadata/column-count"/>
	<xsl:for-each select="//page/rowset[@id='associations']/data/row">
		<xsl:variable name="next_ass" select="position() + 1"/>
		<xsl:variable name="next_next_ass" select="position() + 2"/>
		<xsl:variable name="prev_ass" select="position() - 1"/>
		<xsl:if test="col[@name='association']!='Trial'">
			<xsl:if test="(col[@name='association']!=../row[$prev_ass]/col[@name='association'] and position()!=1) or position()=1">
			<a>
				<xsl:attribute name="href">
		<xsl:choose>
					<xsl:when test="col[@name='association']='NYBA'">http://www.yachtcouncil.com/northwest-yacht-brokers-association.asp</xsl:when>
					<xsl:when test="col[@name='association']='FYBA'">http://www.yachtcouncil.com/florida-yacht-brokers-association.asp</xsl:when>
					<xsl:when test="col[@name='association']='CYBA'">http://www.yachtcouncil.com/california-yacht-brokers-association.asp</xsl:when>
					<xsl:when test="col[@name='association']='YBAA'">http://www.yachtcouncil.com/yacht-brokers-association-of-america.asp</xsl:when>
					<xsl:when test="col[@name='association']='MYBA'">http://www.yachtcouncil.com/mediterranean-yacht-brokers-association.asp</xsl:when>
					<xsl:when test="col[@name='association']='BCYBA'">http://www.yachtcouncil.com/british-columbia-yacht-brokers-association.asp</xsl:when>
					<xsl:when test="col[@name='association']='ABYA'">http://www.yachtcouncil.com/association-of-brokers-yacht-agents.asp</xsl:when>
					</xsl:choose>
				</xsl:attribute>
				<img alt="{col[@name='association']}">
					<xsl:attribute name="src"><xsl:value-of select="$img_path_templates"/>/<xsl:value-of select="$header_bg_color"/>/logos/<xsl:value-of select="col[@name='association']"/>.gif</xsl:attribute>
					<xsl:attribute name="hspace">10</xsl:attribute>
					<xsl:attribute name="vspace">3</xsl:attribute>
					<xsl:attribute name="border">0</xsl:attribute>
				</img>
			</a>
			</xsl:if>
		</xsl:if>
	</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
